import api from './index'
import { axios } from '@/utils/request'

// pmsAreaUrl: '/pms-api/pms/pmsArea/'

/**
 * 路由
 * // pms
    {
        path: '/pms',
        name: 'pms',
        component: PageView,
        redirect: '/pms/pmsArea',
        meta: { title: '地区', icon: 'table', permission: [ 'pms' ] },
        children: [
          {
            path: '/pms/pmsArea',
            name: 'PmsArea',
            component: () => import('@/views/pms/PmsAreaList'),
            meta: { title: '地区', keepAlive: true, permission: [ 'pms_pmsArea' ] }
          }
        ]
      },
 */

/**
 * 查询列表
 * @returns {*}
 */
export function getList (parameter) {
    return axios({
        url: api.pmsAreaUrl,
        method: 'get',
        data: parameter
    })
}

/**
 * 查询详情
 * @param id
 * @returns {*}
 */
export function getPmsArea (id) {
    return axios({
        url: api.pmsAreaUrl + id,
        method: 'get'
    })
}

/**
 * 更新
 * @param id
 * @param parameter
 * @returns {*}
 */
export function updatePmsArea (id, parameter) {
    return axios({
        url: api.pmsAreaUrl + id,
        method: 'post',
        data: parameter
    })
}

/**
 * 新增
 * @param parameter
 * @returns {*}
 */
export function addPmsArea (parameter) {
    return axios({
        url: api.pmsAreaUrl,
        method: 'put',
        data: parameter
    })
}

/**
 * 删除
 * @param id
 * @returns {*}
 */
export function deletePmsArea (id) {
    return axios({
        url: api.pmsAreaUrl + id,
        method: 'delete'
    })
}

/**
 * 批量删除
 * @param id
 * @returns {*}
 */
export function batchDeletePmsArea (parameter) {
    return axios({
        url: api.pmsAreaUrl + 'delete/batch',
        method: 'post',
        data: parameter
    })
}
